package com.joesem.sale.client.logic.home

import android.os.Bundle
import com.joesem.sale.client.base.BaseActivity
import com.joesem.sale.client.base.createViewModel
import com.joesem.sale.client.base.launch
import com.jiaxing.sale.client.databinding.ActivityLaunchBinding
import com.joesem.sale.client.db.LoginTable
import com.joesem.sale.client.logic.login.LoginActivity


class LaunchActivity : BaseActivity<ActivityLaunchBinding>() {

    private val viewModel by createViewModel<LaunchViewModel>()

    override fun showLoading() {

    }

    override fun dismissLoading() {

    }

    override fun ActivityLaunchBinding.initView(savedInstanceState: Bundle?) {
        if (LoginTable.table.isLogin()) {
            launch<MainActivity>()
        } else
            launch<LoginActivity>()
        finish()
    }

    override fun ActivityLaunchBinding.initIntent(intent: Any?) {
        when (intent) {
            is LaunchViewModel.Timing -> {

            }
        }
    }
}